/**
 * 计算某字符出现次数
 * */
const rl = require('readline').createInterface({ input: process.stdin })

let str = ''

rl.on('line', (line) => {
  if (!str) {
    str = line
  } else {
    const upper = line.toUpperCase()
    const lower = line.toLowerCase()
    const reg = new RegExp(`[${upper}${lower}]`, 'g')
    const rst = str.match(reg)
    const num = rst ? rst.length : 0
    console.log(num)
  }
})
